<script src="{$this->data['baseurl']}js/multiselect.js"></script>
<script src="{$this->data['baseurl']}js/category.js"></script>
<script type="text/javascript">
var category_id	= {if $this->data['info']['info']['con']['cid']}{$this->data['info']['info']['con']['cid']}{else}0{/if};
var successFun=function(res){
if(res.code==200){
	document.location	= res.data.forward;
}else{
	alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions); 
    
    var multiSelect		= new MultiSelect('divCategorySelect','hd_category_id',dataMultiCategory,dataAllCategory);
	multiSelect.init();
	multiSelect.select(category_id);
}); 
</script>
<div id="content">
<form id="form" action="{url('Index','SaveEdit')}" method="post">
<h3 class="title">{if $this->data['id']>0}修改{else}添加{/if}{$this->data['page']['name']}模块</h3>
<table width="95%" cellspacing="1" cellpadding="2" border="0" class="admin-table">
	<tr>
		<td class="list_text in">名称</td>
		<td class="list_input">
		<input name="info#name" id="info#name" type="text" tabindex="1" {if $this->data['info']}value="{$this->data['info']['info']['name']}"{/if} /><span etype='error_info' class="error_info"id="info#name_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">更多链接</td>
		<td class="list_input">
		<input name="info#link" id="info#link" type="text" tabindex="2" {if $this->data['info']}value="{$this->data['info']['info']['link']}"{/if} /><span etype='error_info' class="error_info"id="info#link_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">相关关键词</td>
		<td class="list_input">
		<textarea name="info#otherkeyword" id="info#otherkeyword" cols="30" rows="3">{if $this->data['info']}{$this->data['info']['info']['otherkeyword']}{/if}</textarea>
		<span etype='error_info' class="error_info"id="info#otherkeyword">多个关键词之间用,分隔</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">分组</td>
		<td class="list_input">
		<input name="info#mode" id="info#mode" type="text" value="{if $this->data['info']}{$this->data['info']['info']['mode']}{else}0{/if}" /><span etype='error_info' class="error_info"id="info#mode_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">商品ID</td>
		<td class="list_input">
		<textarea name="info#con#ids" id="info#con#ids" cols="30" rows="3">{$this->data['info']['info']['con']['ids']}</textarea>
		<span etype='error_info' class="error_info"id="info#con#ids">多个Id之间用,分隔，填写该条件之后将只使用该条件</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">关键词</td>
		<td class="list_input">
		<input name="info#con#keyword" id="info#con#keyword" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['keyword']}"{/if} />
		<span etype='error_info' class="error_info"id="info#con#keyword_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">商品所在地</td>
		<td class="list_input">
		<input name="info#con#area" id="info#con#area" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['area']}"{/if} />
		<span etype='error_info' class="error_info" id="info#con#area_info">例如:杭州市</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">所属类目</td>
		<td class="list_input">
		<span id="divCategorySelect"></span>
		<input type="hidden" name="info#con#cid" id="hd_category_id" value="{if $this->data['info']['info']['con']['cid']}{$this->data['info']['info']['con']['cid']}{else}0{/if}" />
		<span etype='error_info' class="error_info" id="info#con#cid_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">商品价格</td>
		<td class="list_input">
		<input name="info#con#start_price" id="info#con#start_price" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['start_price']}"{/if} />
		<span etype='error_info' class="error_info"id="info#con#start_price_info"></span> 至 
		<input name="info#con#end_price" id="info#con#end_price" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['end_price']}"{/if} />
		<span etype='error_info' class="error_info"id="info#con#end_price_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">佣金比率</td>
		<td class="list_input">
		<input name="info#con#start_commissionRate" id="info#con#start_commissionRate" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['start_commissionRate']}"{/if} />
		<span etype='error_info' class="error_info"id="info#con#start_commissionRate_info"></span> 至 
		<input name="info#con#end_commissionRate" id="info#con#end_commissionRate" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['end_commissionRate']}"{/if} />
		<span etype='error_info' class="error_info"id="info#con#end_commissionRate_info">请填写乘100后的数字，如3%需填写300</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">30天累计推广量</td>
		<td class="list_input">
		<input name="info#con#start_commissionNum" id="info#con#start_commissionNum" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['start_commissionNum']}"{/if} />
		<span etype='error_info' class="error_info" id="info#con#start_commissionNum_info"></span> 至 
		<input name="info#con#end_commissionNum" id="info#con#end_commissionNum" type="text" {if $this->data['info']}value="{$this->data['info']['info']['con']['end_commissionNum']}"{/if} />
		<span etype='error_info' class="error_info" id="info#con#end_commissionNum_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">卖家信用</td>
		<td class="list_input">
		<select name="info#con#start_credit">
		<option value="1heart" {if $this->data['info']['info']['con']['start_credit']=='1heart'}selected{/if}>一心</option>
		<option value="2heart" {if $this->data['info']['info']['con']['start_credit']=='2heart'}selected{/if}>两心</option>
		<option value="3heart" {if $this->data['info']['info']['con']['start_credit']=='3heart'}selected{/if}>三心</option>
		<option value="4heart" {if $this->data['info']['info']['con']['start_credit']=='4heart'}selected{/if}>四心</option>
		<option value="5heart" {if $this->data['info']['info']['con']['start_credit']=='5heart'}selected{/if}>五心</option>
		<option value="1diamond" {if $this->data['info']['info']['con']['start_credit']=='1diamond'}selected{/if}>一钻</option>
		<option value="2diamond" {if $this->data['info']['info']['con']['start_credit']=='2diamond'}selected{/if}>两钻</option>
		<option value="3diamond" {if $this->data['info']['info']['con']['start_credit']=='3diamond'}selected{/if}>三钻</option>
		<option value="4diamond" {if $this->data['info']['info']['con']['start_credit']=='4diamond'}selected{/if}>四钻</option>
		<option value="5diamond" {if $this->data['info']['info']['con']['start_credit']=='5diamond'}selected{/if}>五钻</option>
		<option value="1crown" {if $this->data['info']['info']['con']['start_credit']=='1crown'}selected{/if}>一冠</option>
		<option value="2crown" {if $this->data['info']['info']['con']['start_credit']=='2crown'}selected{/if}>两冠</option>
		<option value="3crown" {if $this->data['info']['info']['con']['start_credit']=='3crown'}selected{/if}>三冠</option>
		<option value="4crown" {if $this->data['info']['info']['con']['start_credit']=='4crown'}selected{/if}>四冠</option>
		<option value="5crown" {if $this->data['info']['info']['con']['start_credit']=='5crown'}selected{/if}>五冠</option>
		<option value="1goldencrown" {if $this->data['info']['info']['con']['start_credit']=='1goldencrown'}selected{/if}>一黄冠</option>
		<option value="2goldencrown" {if $this->data['info']['info']['con']['start_credit']=='2goldencrown'}selected{/if}>二黄冠</option>
		<option value="3goldencrown" {if $this->data['info']['info']['con']['start_credit']=='3goldencrown'}selected{/if}>三黄冠</option>
		<option value="4goldencrown" {if $this->data['info']['info']['con']['start_credit']=='4goldencrown'}selected{/if}>四黄冠</option>
		<option value="5goldencrown" {if $this->data['info']['info']['con']['start_credit']=='5goldencrown'}selected{/if}>五黄冠</option>
		</select>
		 至 
		<select name="info#con#end_credit">
		<option value="5goldencrown" {if $this->data['info']['info']['con']['end_credit']=='5goldencrown'}selected{/if}>五黄冠</option>
		<option value="4goldencrown" {if $this->data['info']['info']['con']['end_credit']=='4goldencrown'}selected{/if}>四黄冠</option>
		<option value="3goldencrown" {if $this->data['info']['info']['con']['end_credit']=='3goldencrown'}selected{/if}>三黄冠</option>
		<option value="2goldencrown" {if $this->data['info']['info']['con']['end_credit']=='2goldencrown'}selected{/if}>二黄冠</option>
		<option value="1goldencrown" {if $this->data['info']['info']['con']['end_credit']=='1goldencrown'}selected{/if}>一黄冠</option>
		<option value="5crown" {if $this->data['info']['info']['con']['end_credit']=='5crown'}selected{/if}>五冠</option>
		<option value="4crown" {if $this->data['info']['info']['con']['end_credit']=='4crown'}selected{/if}>四冠</option>
		<option value="3crown" {if $this->data['info']['info']['con']['end_credit']=='3crown'}selected{/if}>三冠</option>
		<option value="2crown" {if $this->data['info']['info']['con']['end_credit']=='2crown'}selected{/if}>两冠</option>
		<option value="1crown" {if $this->data['info']['info']['con']['end_credit']=='1crown'}selected{/if}>一冠</option>
		<option value="5diamond" {if $this->data['info']['info']['con']['end_credit']=='5diamond'}selected{/if}>五钻</option>
		<option value="4diamond" {if $this->data['info']['info']['con']['end_credit']=='4diamond'}selected{/if}>四钻</option>
		<option value="3diamond" {if $this->data['info']['info']['con']['end_credit']=='3diamond'}selected{/if}>三钻</option>
		<option value="2diamond" {if $this->data['info']['info']['con']['end_credit']=='2diamond'}selected{/if}>两钻</option>
		<option value="1diamond" {if $this->data['info']['info']['con']['end_credit']=='1diamond'}selected{/if}>一钻</option>
		<option value="5heart" {if $this->data['info']['info']['con']['end_credit']=='5heart'}selected{/if}>五心</option>
		<option value="4heart" {if $this->data['info']['info']['con']['end_credit']=='4heart'}selected{/if}>四心</option>
		<option value="3heart" {if $this->data['info']['info']['con']['end_credit']=='3heart'}selected{/if}>三心</option>
		<option value="2heart" {if $this->data['info']['info']['con']['end_credit']=='2heart'}selected{/if}>两心</option>
		<option value="1heart" {if $this->data['info']['info']['con']['end_credit']=='1heart'}selected{/if}>一心</option>
		</select>
		<span etype='error_info' class="error_info"id="info#con#start_credit_info"></span>
		<span etype='error_info' class="error_info"id="info#con#end_credit_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">排序</td>
		<td class="list_input">
		<select name="info#con#sort">
		<option value="price_desc" {if $this->data['info']['info']['con']['sort']=='price_desc'}selected{/if}>价格从高到低</option>
		<option value="price_asc" {if $this->data['info']['info']['con']['sort']=='price_asc'}selected{/if}>价格从低到高</option>
		<option value="credit_desc" {if $this->data['info']['info']['con']['sort']=='credit_desc'}selected{/if}>信用等级从高到低</option>
		<option value="commissionRate_desc" {if $this->data['info']['info']['con']['sort']=='commissionRate_desc'}selected{/if}>佣金比率从高到底</option>
		<option value="commissionRate_asc" {if $this->data['info']['info']['con']['sort']=='commissionRate_asc'}selected{/if}>佣金比率从低到高</option>
		<option value="commissionNum_desc" {if $this->data['info']['info']['con']['sort']=='commissionNum_desc'}selected{/if}>成交量从高到低</option>
		<option value="commissionNum_asc" {if $this->data['info']['info']['con']['sort']=='commissionNum_asc'}selected{/if}>成交量从低到高</option>
		<option value="commissionVolume_desc" {if $this->data['info']['info']['con']['sort']=='commissionVolume_desc'}selected{/if}>总支出佣金从高到底</option>
		<option value="commissionVolume_asc" {if $this->data['info']['info']['con']['sort']=='commissionVolume_asc'}selected{/if}>总支出佣金从低到高</option>
		<option value="delistTime_desc" {if $this->data['info']['info']['con']['sort']=='delistTime_desc'}selected{/if}>商品下架时间从高到底</option>
		<option value="delistTime_asc" {if $this->data['info']['info']['con']['sort']=='delistTime_asc'}selected{/if}>商品下架时间从低到高</option>
		</select>
		<span etype='error_info' class="error_info"id="info#con#sort_info"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">显示顺序</td>
		<td class="list_input">
		<input name="orderby" id="orderby" type="text" value="{if $this->data['info']}{$this->data['info']['orderby']}{else}0{/if}" />
		<span etype='error_info' class="error_info"id="orderby_info">数字越大显示在越前面</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">更新周期</td>
		<td class="list_input">
		<input name="info#updateperiod" id="info#updateperiod" type="text" value="{if $this->data['info']}{$this->data['info']['info']['updateperiod']}{else}24{/if}" /><span etype='error_info' class="error_info"id="info#updateperiod_info">自动更新的周期，设置为0不自动更新数据，单位小时</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">获取条数</td>
		<td class="list_input">
		<input name="info#con#page_size" id="info#con#page_size" type="text" value="{if $this->data['info']}{$this->data['info']['info']['con']['page_size']}{/if}" /><span etype='error_info' class="error_info"id="info#con#page_size_info">要获取的商品数量，最大40，默认40，使用商品ID查询时该条件无效</span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">是否消保商家</td>
		<td class="list_input">
		<input name="info#con#guarantee" id="info#con#guarantee" type="checkbox" value="true" {if $this->data['info']['info']['con']['guarantee']=='true'}checked{/if} />
		<span etype='error_info' class="error_info" id="info#con#guarantee"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">是否海外商品</td>
		<td class="list_input">
		<input name="info#con#overseas_item" id="info#con#overseas_item" type="checkbox" value="true" {if $this->data['info']['info']['con']['overseas_item']=='true'}checked{/if} />
		<span etype='error_info' class="error_info" id="info#con#overseas_item"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in">是否商城商品</td>
		<td class="list_input">
		<input name="info#con#mall_item" id="info#con#mall_item" type="checkbox" value="true" {if $this->data['info']['info']['con']['mall_item']=='true'}checked{/if} />
		<span etype='error_info' class="error_info" id="info#con#mall_item"></span>
		</td>
	</tr>
	<tr>
		<td class="list_text in"></td>
		<td class="list_input">
		<input id="btnSave" type="submit" value="保存" />&nbsp;&nbsp;<input type="button" onclick="history.back()" value="返回" />
		<input name="id" type="hidden" value="{$this->data['id']}" />
		<input name="position" type="hidden" value="{$this->data['position']}" />
		</td>
	</tr>
</table>
</form>
</div>